home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Textra120 / Docs / RexxCommand.doc < prev    next >
Encoding:
Text File  |  1996-11-02  |  35.8 KB  |  1,170 lines

  1.  
  2.  
  3.          TREXXTRA, The TEXTRA-to-ARexx Command Interface!
  4.  
  5.             (The mother-of-all-concatenated-names!!!)
  6.  
  7.                  again, by Mike Haas  (who else?)
  8.  
  9.  
  10.  
  11.     *** Many THANX to Martin Kees, who generously contributed ***
  12.        his AREXX original interface design and implementation.
  13.     
  14.       *** Many THANX to James Cooper of SAS Institute, Inc. ***
  15.             for contributing the SAS/C interface scripts.
  16.       
  17.    *** Many THANX to all the registered users who have reported ***
  18.           bugs and contributed a wealth of much-appreciated
  19.                 suggestions for our favorite editor.
  20.     
  21.  
  22.     This document describes the TEXTRA commands that may be placed 
  23.     within ARexx scripts and launched from within TEXTRA via the 
  24.     "Utilities, AREXX..." menu item or key-equivalent.
  25.  
  26.     TEXTRA introduced its ARexx interface in v1.10.  I'll make every 
  27.     attempt to keep later versions backward-compatible and NOT break 
  28.     any existing scripts later on.
  29.     
  30.     This document describes the feature set of Textra Version 1.15 
  31.     through 1.18.  A complete Revision History for the ARexx interface 
  32.     is at end of this document.
  33.     
  34.           
  35. A Quick example...
  36.  
  37. Before trying anything, copy the provided TEXTRA ARexx script
  38. files, the ones in the provided "Scripts" directory, into your
  39. rexx: directory.  The provided Textra_Install program will do that
  40. for you automatically.  (This need be done only once and completes
  41. the TEXTRA AREXX Interface installation on your system.)
  42.  
  43. (Alternatively, you could temporarily assign rexx: to the Scripts 
  44. directory.  If necessary, refer to your Amiga System Manuals for 
  45. information about any of these operations.)
  46.  
  47. Launch TEXTRA by double-clicking on its icon and click on the
  48. 'CANCEL' button on the file requester.
  49.  
  50. Pull-down the "Utilities, AREXX..." menu item and, if not already 
  51. present, enter  Tutorial  into one of the string gadgets and press 
  52. RETURN.  (Note: you can clear one first with Rt-Amiga-X, if 
  53. necessary).
  54.  
  55. Please feel free to use the provided scripts as a basis for developing 
  56. your own ARexx programs, if you are inclined to such things.  If you 
  57. do, and can see your way clear, please send me a copy of your stuff...  
  58. if you wish it to be included in the standard release package, include 
  59. a signed statement to that effect, OK?
  60.  
  61. Mike Haas
  62. 3867 La Colina Rd.
  63. El Sobrante, CA. 94803
  64.  
  65.  
  66.  
  67. AREXX Scripts containing the TEXTRA commands described in 
  68. this file may reside in either of 2 places:
  69.  
  70. 1. The REXX: directory (if you have one ASSIGNed)
  71.     
  72.                     OR
  73.  
  74. 2. The Textra "startup" directory...
  75.     
  76.    a. If you launch TEXTRA from Workbench, this is the same
  77.       directory that TEXTRA is in.
  78.        
  79.    b. If you run TEXTRA from CLI/Shell, this is the "current
  80.       directory" of the CLI/Shell when you launch Textra.
  81.     
  82.  
  83.  
  84. Notes about TEXTRA Command Invocations from ARexx scripts...
  85.  
  86. 1. When specifying strings in TEXTRA commands, encase them 
  87.    in double-quotes, even if there is no whitespace.  
  88.    (Otherwise, ARexx will convert all your characters to 
  89.    UPPER case.  Nice of it, huh?)
  90.  
  91. 2. Script usage is case-INsensitive for the TEXTRA commands 
  92.    and keyword-matching.
  93.  
  94. 3. TEXTRA will sometimes set combinations of 2 pre-defined 
  95.    AREXX variables, RESULT and RC (return code).  Both are 
  96.    strings, RESULT being primarily informational in nature 
  97.    and RC used for error situation return values 
  98.    ('out-of-range value' or 'not found' type error codes).
  99.    
  100.    Note that to retrieve the RESULT string, if used, the 
  101.    AREXX program must have declared OPTIONS RESULTS 
  102.    somewhere previously.  RC is always available and TEXTRA 
  103.    will return 0 in it for a SUCCESS condition or a non-zero 
  104.    value (5 is considered a minor condition, 10 is the more 
  105.    serious type, etc.).
  106.    
  107.    
  108. The remainder of this document is divided into the following
  109. sections, each describing commands related to that topic...
  110.  
  111.    Movement commands
  112.    Set Selected Area
  113.    Operations on Selected Areas
  114.    Interactive Control
  115.    File/Window Management
  116.  
  117. There is some overlap to the functionality of these sections,
  118. so if you're looking for a specific capability, scan everything.
  119.  
  120. The commands themselves...
  121.  
  122.  
  123.  ===================================================================
  124.  Movement Commands
  125.  ===================================================================
  126.  
  127.  
  128.  GOTOXY x y            move cursor to x y position
  129.  
  130.     Place the cursor to the given 'x y' coordinates, where
  131.     'x' is the decimal column position (starting with 0) and 'y'
  132.     is the decimal line number (starting with 0).
  133.     
  134.     'rc' set to:
  135.     
  136.      0 = 'x y' within range of text
  137.      5 = 'x' too large (cursor positioned to end-of-line)
  138.     10 = 'y' too large (no change in cursor/selection)
  139.  
  140.  
  141.  GOTOXY1 x y        move cursor to x y position (1's-based)
  142.  
  143.     This command is identical with GOTOXY, except that it accepts
  144.     'x' and 'y' arguments which start with 1 (passing less than 1 for
  145.     either will set 'rc' as indicated above).
  146.  
  147.  
  148.  UP   n                cursor up n lines
  149.  
  150.     'rc' set to:
  151.     
  152.      0 = cursor position was successfully changed by at least 1 line
  153.      5 = cursor was at top line to begin with
  154.      
  155.      
  156.  DOWN n                cursor down n lines
  157.  
  158.     'rc' set to:
  159.     
  160.      0 = cursor position was successfully changed by at least 1 line
  161.      5 = cursor was at bottom line to begin with
  162.      
  163.      
  164.  RIGHT n            cursor right n characters
  165.  
  166.     'rc' set to:
  167.     
  168.      0 = cursor position was successfully changed by at least 1 column
  169.      5 = cursor was at last character in file to begin with
  170.      
  171.      
  172.  LEFT  n            cursor left  n characters
  173.  
  174.     'rc' set to:
  175.     
  176.      0 = cursor position was successfully changed by at least 1 column
  177.      5 = cursor was at first character in file to begin with
  178.      
  179.      
  180.  FIRSTLINE        cursor to beg of file (rc always = 0)
  181.   
  182.  
  183.  LASTLINE        cursor to end of file (rc always = 0)
  184.  
  185.  
  186.  TOP            cursor up to topline of visable page (rc always = 0)
  187.  
  188.  
  189.  BOTTOM            cursor to bottom line of visable page (rc always = 0)
  190.  
  191.  
  192.  CENTER            cursor to middle line (rc always = 0)
  193.  
  194.  
  195.  HOPTO next word    cursor to start of next word
  196.  HOPTO prev word    cursor to END of prev word
  197.  HOPTO next char    cursor to next non-white
  198.  HOPTO prev char     cursor to prev non-white
  199.  HOPTO next blank     cursor to next whitespace char
  200.  HOPTO prev blank     cursor to prev whitespace char
  201.  
  202.     HOPTO moves the cursor to a specific position relative to the
  203.     current cursor or selection location.  The direction and
  204.     ultimate destination position is determined by the keywords
  205.     provided.
  206.     
  207.     HOPTO observes the current setting of the PREFS attribute
  208.     'AlphanumericHops' (see the PREFS command) to determine how it
  209.     skips over characters and words.
  210.     
  211.     'rc' set to:
  212.     
  213.      0 = SUCCESS
  214.     10 = keywords supplied to HOPTO were invalid
  215.      
  216.     if 'rc' = 0, 'result' set to:
  217.     
  218.      "<number>" = cursor column
  219.     "NOT FOUND" = could not HOPTO (at one end of file)
  220.      
  221.  
  222.  LINE <num>
  223.  
  224.     Positions the cursor at the beginning of the specified
  225.     line (relative to 0).  Specifying -1 will place the cursor
  226.     at the beginning of the current cursor line.  If a select
  227.     range exists, the line on which it starts is considered
  228.     the 'current' line.
  229.     
  230.     For results, see GOTOXY.
  231.  
  232.  
  233.  LINE1 <num>     *** 1's based ***
  234.  
  235.     Same as LINE, but 1's-based.  For results, see GOTOXY.
  236.  
  237.  
  238.  COLUMN <num>
  239.  
  240.     Positions the cursor at column <num> of the current
  241.     line (relative to 0).  Specifying -1 will move the cursor
  242.     to the end of the current cursor line.  If a select
  243.     range exists, the line on which it starts is considered
  244.     the 'current' line.
  245.     
  246.     For results, see GOTOXY.
  247.  
  248.  
  249.  COLUMN1 <num>     *** 1's based ***
  250.  
  251.     Same as COLUMN, but 1's-based.  For results, see GOTOXY.
  252.  
  253.  
  254.  ===================================================================
  255.  Set Selected Area
  256.  ===================================================================
  257.  
  258.  
  259.  SELECTLINE n        select and display line n
  260.  
  261.     Same as the 'Go to Line...' menu item.  No effect if 'line n'
  262.     is not both a valid decimal number and in range for the file.
  263.     (rc always = 0)
  264.  
  265.  
  266.  FIND "text"        find "text", observe wrap setting
  267.  
  268.     Find and select the specified text.  The search is case-INsensitive.
  269.     
  270.     'result' set to:
  271.     
  272.            "OK" = text has been located, selected and displayed
  273.     "NOT FOUND" = could not be found
  274.     
  275.     (rc always = 0)
  276.  
  277.  
  278.  FINDNEXT
  279.  
  280.     Conducts another search for the same string, see FIND.
  281.  
  282.  
  283.  SELECTTO x y
  284.  
  285.     Used to establish or modify a select range as follows:
  286.     
  287.     - If 'x y' is below the current cursor location or start
  288.       of selection,    'x y' then becomes the new start of selection.
  289.     
  290.     - If 'x y' is after the current cursor location or end of
  291.       selection, 'x y' then becomes the new end of selection.
  292.     
  293.     - If 'x y' is within the current selection, then 'x y' becomes
  294.       the new end of selection.
  295.  
  296.     (rc always = 0)
  297.  
  298.  
  299.  HOPSELECT next word
  300.  HOPSELECT prev word
  301.  HOPSELECT next char
  302.  HOPSELECT prev char
  303.  
  304.     HOPSELECT establishes a selection relative to the current
  305.     cursor or selection location.  The direction and destination
  306.     selection is determined by the keywords    provided.
  307.  
  308.     HOPSELECT observes the current setting of the PREFS attribute
  309.     'AlphanumericHops' (see the PREFS command) to determine how it
  310.     selects characters and words.
  311.     
  312.     'rc' set to:
  313.     
  314.      0 = SUCCESS
  315.     10 = keywords supplied to HOPSELECT were invalid
  316.      
  317.     if 'rc' = 0, 'result' set to:
  318.     
  319.      "<number>" = length of selected string
  320.     "NOT FOUND" = could not HOPSELECT (at one end of file)
  321.      
  322.  
  323.  UNSELECT          make sure nothing is selected
  324.  
  325.     If there is a selection, place the cursor at the end of it.
  326.     No effect if nothing selected.
  327.     (rc always = 0)
  328.  
  329.  
  330.  ===================================================================
  331.  Operations on Selected Areas
  332.  ===================================================================
  333.  
  334.  
  335.  CUT
  336.  
  337.     Same as the 'CUT' menu item.  No effect if nothing selected.
  338.     rc = 30 if window is write protected, otherwise 0
  339.  
  340.  
  341.  COPY
  342.  
  343.     Same as the 'COPY' menu item.  No effect if nothing selected.
  344.     (rc always = 0)
  345.  
  346.  
  347.  PASTE
  348.  
  349.     Same as the 'PASTE' menu item.  No effect if nothing has been
  350.     CUT or COPY'ed. rc = 30 if window is write protected, otherwise 0
  351.  
  352.  
  353.  KILLSELECT
  354.  
  355.     If a select range exists, delete it.  Do NOT save it in the
  356.     clipboard.  rc = 30 if window is write protected, otherwise 0
  357.  
  358.     'result' set to:
  359.     
  360.     "OK" if a select range existed.  The cursor will now reside
  361.          where the select range previously began. 
  362.     
  363.     "NO SELECT" = There is no selection.  (nothing is changed)
  364.     "WRITE PROTECTED" = window must be unlocked, see WRITEENABLE
  365.  
  366.  
  367.  LOCASE
  368.  
  369.     Selected or next word to lower case.  rc = 30 if window is
  370.     write protected, otherwise 0
  371.  
  372.  
  373.  HICASE
  374.  
  375.     Selected or next word to upper case.  rc = 30 if window is
  376.     write protected, otherwise 0
  377.  
  378.  
  379.  CAPS
  380.  
  381.     Capitalize the selected or next word.  rc = 30 if window is
  382.     write protected, otherwise 0
  383.  
  384.  
  385.  ===================================================================
  386.  INTERACTIVE Control
  387.  ===================================================================
  388.  
  389.  
  390.  TEXT token
  391.  
  392.     Inserts the 'token' into the current window at the current
  393.     cursor location.  If a select range exists, it is deleted
  394.     before the insertion.  rc = 30 if window is    write protected,
  395.     otherwise 0
  396.  
  397.  
  398.  TEXTN token
  399.  
  400.     Same as TEXT, but includes a newline after the specified string.
  401.     rc = 30 if window is write protected, otherwise 0
  402.  
  403.  
  404.  NEWLINE
  405.  
  406.     Inserts a newline into the current window at the current
  407.     cursor location.  If a select range exists, it is deleted
  408.     before the insertion. rc = 30 if window is write protected,
  409.     otherwise 0
  410.  
  411.  
  412.  BACKSPACE
  413.  
  414.     Same behavior as the BackSpace key on the keyboard.
  415.     rc = 30 if window is write protected, otherwise 0
  416.  
  417.  
  418.  DEL
  419.  
  420.     Same behavior as the DEL key on the keyboard.
  421.     rc = 30 if window is write protected, otherwise 0
  422.  
  423.  
  424.  PREFS attribute action
  425.  
  426.     Perform an action to the specified Edit or Printing Preferences
  427.     attribute.  The action may be to either read and return the
  428.     current setting of the attribute, or set it.
  429.     
  430.     The valid attribute keywords are listed here, along with the
  431.     appropriate action keywords for each...
  432.  
  433.     Usage:   PREFS [AutoIndent]        [read on off]
  434.                    [AutoBackspace]     [read on off]
  435.                    [PrintLineNumbers]  [read on off]
  436.                    [PrintPageHeaders]  [read on off]
  437.                    [TabWidth]          [read <value>]
  438.                    [Alphanumeric]      [read on off]
  439.                    [AlphanumericHops]  [read on off]
  440.                    [WrapFind]          [read on off]
  441.     
  442.     If the action is 'read', the returned string will either be
  443.     "ON", "OFF", or "<value>", depending on whether the attribute
  444.     is a 'state' or 'numeric' variable.
  445.     
  446.     example:   PREFS AutoIndent read
  447.                AIstatus = result    /* should be ON or OFF */
  448.                
  449.     If the action is to set the attribute, then the action keyword
  450.     will be either "ON", "OFF" or "<value>", depending on whether
  451.     the attribute is a 'state' or 'numeric' variable.  If the
  452.     attribute is successfully set, the string "OK" will be returned.
  453.     
  454.     NOTE: setting the    PREFS Alphanumeric  attribute to 'off'
  455.           automatically infers the 'Non-Whitespace" mode of selecting
  456.           text on double-click mouse events.
  457.     
  458.     NOTE: the    PREFS AlphanumericHops [read on off]   attribute,
  459.           determines how the HOPTO and HOPSELECT commands will look
  460.           at text. Turning this attribute off automatically infers
  461.           the 'Non-Whitespace" mode of parsing text.
  462.     
  463.     NOTE: the WrapFind setting is initialized to OFF at the beginning
  464.           of each script or command invocation.  This attribute applies
  465.           ONLY to the FIND and FINDNEXT commands (is independant of
  466.           the Wrap setting in the FIND STRING... requester).
  467.     
  468.     examples:   PREFS AutoIndent on
  469.                 AIstatus = result    /* should be OK */
  470.                 
  471.                 PREFS TabWidth read
  472.                 notify result
  473.  
  474.     'rc' set to:
  475.     
  476.      0 = SUCCESS
  477.     10 = keywords supplied to PREFS were invalid
  478.      
  479.     if 'rc' = 0 and action is "read", 'result' set to:
  480.     
  481.         "<number>" = if requested attribute is numeric in nature
  482.      "ON" or "OFF" = if requested attribute is a 'state'
  483.      
  484.  
  485.  GET item attribute
  486.  
  487.     GET is used to aquire information about a certain 'attribute'
  488.     of a particular 'item'.
  489.  
  490.     'rc' set to:
  491.     
  492.      0 = SUCCESS
  493.     10 = keywords supplied to GET were invalid
  494.     
  495.     Assuming the given keyword pairs are valid (in the following list),
  496.     'result' will be set as indicated.
  497.  
  498.     A brief summary of the available reports:
  499.     
  500.     GET cursor position    - report column & line of cursor
  501.     GET cursor char        - report character at cursor position
  502.     GET file name        - get just the filename (no path)
  503.     GET file path        - get just the file path (no name)
  504.     GET file info       - get characteristics of the file
  505.     GET window info     - get characteristics of the window
  506.     GET window <num>    - get 'window-pointer' for window N
  507.     GET window font     - get font of current window
  508.     GET line <num>        - return text of line
  509.     GET select position    - return start and end points of select range
  510.     GET select text        - return the string that is selected
  511.     GET select next        - used after 'get select text' to get later lines
  512.     
  513.     Specific info about each command...
  514.  
  515.     GET cursor position
  516.     
  517.         'result' set to:
  518.         
  519.         "x y" = column & line numbers, both 0-based (ex: "0 13"
  520.                 to indicate first column of the fourteenth line).
  521.                 Use "PARSE var result col ' ' line" in AREXX scripts.
  522.         
  523.         "SELECT" = There is no cursor (a selection exists).
  524.     
  525.     GET cursor char
  526.     
  527.         'result' set to:
  528.         
  529.         "c" = a single-character string (or "-1" if on empty line)
  530.         
  531.         "SELECT" = There is no cursor as a selection exists.
  532.         
  533.     GET file name    'result' set to "filename"
  534.     
  535.     GET file path    'result' set to "vol:dir/" or "vol:" format
  536.     
  537.     GET file info    'result' set to "string" describing characteristics
  538.         
  539.         'result' set to:
  540.         
  541.         "modified? numLines size-in-mem size-on-disk"
  542.         
  543.         where:
  544.         
  545.             modified? = "YES" or "NO"
  546.             
  547.             numLines = number of lines in memory
  548.         
  549.             size-in-mem = number of characters in memory
  550.         
  551.             size-on-disk = number of characters on disk (-1 if
  552.                            file doesn't exist or error)
  553.         
  554.     GET window info  'result' set to "string" describing characteristics
  555.         
  556.         'result' set to:
  557.         
  558.         "left top width height numVisLines numVisChars"
  559.         
  560.         where:
  561.         
  562.             left = window left edge
  563.         
  564.             top = window topedge
  565.         
  566.             width = window width
  567.         
  568.             height = window height
  569.         
  570.             numVisLines = height in visible text lines
  571.         
  572.             numVisChars = width in visible characters
  573.         
  574.             NOTE: all coordinates relative to screen 0,0
  575.     
  576.     GET window <num>    obtain the 'window-pointer' for window N
  577.     
  578.         <num> must be in the range of from 1 to number-of-windows.
  579.         
  580.         This command is especially useful for doing something to
  581.         each open Textra window, when used in combination with
  582.         the SELECTWINDOW command.
  583.         
  584.         ONE SHOULD BE AWARE OF THE FOLLOWING CAVEAT WHEN USING
  585.         THIS COMMAND VARIANT:  If a window is closed by any
  586.         means (meaning the 'number-of-windows' is lowered), one
  587.         cannot assume that the same 'window-pointer' value will
  588.         be returned for the same <num> argument.  For example,
  589.         if 'GET window 2' returns -148200, and then window 1
  590.         is closed, 'GET window 2' may now be invalid (if there
  591.         is only 1 window left), and 'GET window 1' will now
  592.         return the -148200 window value.  (This is not a
  593.         consideration if new windows are opened, just when they
  594.         are closed.)
  595.         
  596.         'result' set to:
  597.         
  598.             'window-pointer'  = if <num> was in range
  599.                            0  = if <num> was out of range
  600.         
  601.     GET window font
  602.     
  603.         Returns a string describing the current window's font and size.
  604.     
  605.         'result' set to:
  606.         
  607.             "fontname size" = example:  topaz 8
  608.         
  609.     GET line <num>
  610.     
  611.         'rc' set to:
  612.         
  613.         10 = <num> is too large (the specified line doesn't exist),
  614.     
  615.         otherwise, 'result' set to:
  616.         
  617.         "line text" = contents of line <num>
  618.         
  619.     GET select position
  620.     
  621.         'result' set to:
  622.         
  623.         "startx starty endx endy" = select range coordinates.
  624.         
  625.             (For example, "0 0 2 4" indicates that from the first
  626.              column of the first line to the third column of the fifth
  627.              line is selected.  From AREXX, use:
  628.              PARSE var result startx' 'starty' 'endx' 'endy    )
  629.         
  630.         "NO SELECT" = There is no selection.
  631.         
  632.     GET select text        "(num) selected text"  |  "NO SELECT"
  633.     
  634.         Used to retrieve the current selection, or at least
  635.         the component of it that is on the first line.  The
  636.         first portion of the returned string is always the number
  637.         of remaining lines that can be returned via "GET select next".
  638.         This number is always followed by a SPACE character, then the
  639.         selected text on that line.
  640.         
  641.         For example, if "0 Four score" is returned, the caller knows
  642.         that the selection does not extend over 1 line and that the
  643.         selected text is "Four Score".
  644.         
  645.         If "1 seven years ago," is returned, the caller knows
  646.         that the selected text is "seven years ago," and that
  647.         the selection extends over to the next line (see
  648.         "GET select next").
  649.         
  650.         'result' set to:
  651.         
  652.         "<num> selected text" = <num> is number of times to call
  653.                                 "GET select next" (separated by a
  654.                                 SPACE character from the text).
  655.         
  656.         "NO SELECT" = no selection currently exists.
  657.  
  658.     GET select next        "numleft selected text"  |  "NO SELECT"
  659.         
  660.         Used to retrieve remaining lines, if the previous
  661.         "GET select text" indicated it should be called at all.
  662.         It returns the same format string as "GET select text",
  663.         but will return a 'numleft' component that decreases
  664.         by 1 each time, ultimately to zero.
  665.  
  666.         'result' set to:  same as "GET select text"
  667.         
  668.         NOTE: returns just "0" if called past end of selection.
  669.  
  670.  
  671.  WAITFOR num
  672.  
  673.     Wait for 'num' seconds, where 'num' is a decimal number of
  674.     the form "4.36" or "4".  Minimum resolution is .02 seconds,
  675.     and with the speed AREXX operates at, that should be quite
  676.     sufficient!
  677.  
  678.  
  679.  CLEAR
  680.  
  681.     Delete all text from and blank the current window.
  682.     rc = 30 if window is write protected, otherwise 0
  683.  
  684.  
  685.  NOTIFY "token"
  686.  
  687.     Presents a standard informational 'Please Note!' requester
  688.     to the user and waits for him/her to click the single 'OK'
  689.     button.  The token string is presented in the requester
  690.     and should not exceed 60 characters in length.  Does not
  691.     return a result.  rc always = 0.
  692.  
  693.  
  694.  ASK "token"
  695.  
  696.     Presents a standard 'YES/NO' requester to the user and waits
  697.     for him/her to click on a button.  The token string
  698.     is presented in the requester and should not exceed 60
  699.     characters in length.  rc always = 0.
  700.     
  701.     'result' set to:
  702.     
  703.     "YES" or "NO", depending of course on which button was clicked.
  704.  
  705.  
  706.  TEXTRAVERSION   (only in v1.12 and later)
  707.  
  708.     Returns a string describing the TEXTRA major and minor versions, 
  709.     as well as the incremental version of the AREXX interface 
  710.     (increments with each release that contains a modification to
  711.      the interface code and/or command set).
  712.     
  713.     format:   major-version minor-version rexxinterface
  714.  
  715.     for example:    1            12             2
  716.  
  717.     "1 12 2" will be returned for v1.12, last 2 indicates
  718.              AREXX interface, rev2.  This should increment with
  719.              every release that contains an ARexx interface
  720.              addition, deletion, modification, or fix.
  721.     
  722.     "1 13 5" is returned for 1.13
  723.  
  724.     The 3rd digit will never be less than 2, as it was that rev
  725.     which implemented this command.
  726.     
  727.     The commands in the following list have been added since the
  728.     initial V1.10 release (which first incorporated the ARexx
  729.     interface).  For best results, you should check for the highest
  730.     relevant rexx version at the beginning of your script (rexx
  731.     code for checking shown below)...
  732.     
  733.     min Rexx revision              needed for command
  734.     -----------------              ------------------
  735.         2  (v1.12)         OPENFILE, FINDFILE, SELECTWINDOW, SAVEAS
  736.         
  737.         5  (v1.13)         INSERTFILE, CHECKCANCEL, CLOSEWINDOW,
  738.                            RETURNPROMPT, RETURNPROMPTN,
  739.                            PREFS Alphanumeric, PREFS AlphanumericHops,
  740.                            address Textra (with no command string)
  741.         
  742.         6  (v1.14)         QUITTEXTRA
  743.         
  744.        12  (v1.15)         MARKSELECT, GOTOMARK, DELETEMARK,
  745.                            PREFS WrapFind [action], GOTOXY1,
  746.                            STATUSTEXT, LINE, LINE1, COLUMN, COLUMN1,
  747.                            GET file info, GET window info,
  748.                            GET window <num>, OPENFILEWAIT
  749.  
  750.        13  (v1.17)         GET window font, SETFONT
  751.         
  752.     
  753.     For example, if the most recent command listed that your 
  754.     script uses is CHECKCANCEL, you will want to check for 
  755.     rexx ver of 5.  However, if you call QUITTEXTRA, you will need 
  756.     rexx ver 6.
  757.     
  758.     Note that not checking for an appropriate rexx version will 
  759.     not crash older, incompatible versions of the editor, but the 
  760.     user may be confronted with less-explanatory 'unknown 
  761.     command' error requesters.  Checking the rexx ver is how you 
  762.     can explain just what the problem is.
  763.     
  764.     The following ARexx example illustrates how to check for a 
  765.     specific rexx version.  This example checks for rexx ver of 
  766.     5, indicated by the "(rex < 5)" statement on the 6th line:
  767.     
  768.         options results
  769.     
  770.         rex = 0; result = "NOTSUPPORTED"
  771.         textraversion
  772.         parse var result maj min rex
  773.         if (result == "NOTSUPPORTED") | (rex < 5) then do
  774.             notify "Textra V1.13 or later required for this script."
  775.             exit
  776.         end
  777.     
  778.     As of V1.13, all release TEXTRA scripts check that the 
  779.     TEXTRA that is calling them is of a compatible version as 
  780.     appropriate.
  781.  
  782.  
  783.  CHECKCANCEL
  784.  
  785.     Checks whether the user wants to cancel the command.  To
  786.     respond accordingly, the programmer should put something like
  787.     this in his/her ".textra" script:
  788.     
  789.        /* Check if the user wants to cancel... */
  790.        CheckCancel; if (result == CANCEL) then exit
  791.     
  792.     Note that the script has the ability to perform specific actions
  793.     before exiting, such as flushing data for example.
  794.     
  795.     'result' set to:
  796.     
  797.     "CANCEL"     The user wants to cancel current operation
  798.     
  799.     "NO"         Do not cancel
  800.  
  801.  
  802.  RETURNPROMPT "string"
  803.  
  804.     Presents the specified string as a prompt, then waits for the user 
  805.     to press the RETURN or ENTER keys.  Until either is pressed, other 
  806.     keys are entered into the document as usual.  (If the specified
  807.     string is entered as "noprompt", none is presented).
  808.  
  809.     When the user presses RETURN, 4 values are returned as the 
  810.     'result' string.  These represent the starting x, y and ending x, 
  811.     y coordinates for the "response".
  812.     
  813.     The response is considered to be either:
  814.     
  815.        - Any selected text.   (OR, if no text is selected...)
  816.        
  817.        - The cursor position when the command was invoked is
  818.          considered the start x, y.  The end x, y is the position
  819.          when the RETURN key was pressed.
  820.  
  821.     'result' set to:
  822.     
  823.     "WRITE PROTECTED" = window must be unlocked via WRITEENABLE
  824.     
  825.     "startx starty endx endy" = successful query
  826.     
  827.     This can be retrieved via:
  828.     
  829.        parse var result startx starty endx endy
  830.  
  831.  
  832.  RETURNPROMPTN "string"
  833.  
  834.     Works exactly as does RETURNPROMPT, but also adds a NEWLINE after 
  835.     the prompt is displayed, allowing the response to occupy an entire
  836.     line.
  837.     
  838.     See RETURNPROMPT for all other details.
  839.     
  840.     
  841.  QUITTEXTRA <exit-save-action>
  842.  
  843.     There are 3 possible forms of this command:
  844.  
  845.       QUITTEXTRA prompt   (normal shutdown, prompts if files modified)
  846.       QUITTEXTRA save     (doesn't prompt, always saves modified files)
  847.       QUITTEXTRA nosave   (doesn't prompt, doesn't save modified files)
  848.  
  849.     NOTE: The last two forms of this command have special user
  850.     interface considerations.  
  851.     
  852.     Users of a script containing such a command may not desire to have 
  853.     their files saved, almost certainly not discarded.  Use carefully! 
  854.     Make sure others know if you use either of these forms.  (None of 
  855.     the release scripts use any form of the QUITTEXTRA command).
  856.       
  857.     Note that Textra will not exit if a print job is active.  If an ARexx 
  858.     script is running, the exit is postponed until the script finishes.  
  859.  
  860.  
  861.  MARKSELECT <Mark name>
  862.  
  863.     Create a mark called <Mark name> (will be truncated
  864.     to 31 characters maximum length), which will be
  865.     associated with the currently-selected text.  The
  866.     name will be made available to the GUI as well as
  867.     the GOTOMARK and DELETEMARK commands.
  868.     
  869.     Note that an existing mark of the same <Mark name>
  870.     will be replaced with the new mark.
  871.     
  872.     'result' set to:
  873.     
  874.     "OK"   - Mark defined
  875.     
  876.     "NO"   - an error prevented definition of the mark
  877.     
  878.     "NO SELECT" - no select range is highlighted to mark.
  879.     
  880.     "WRITE PROTECTED" - window must be unlocked via WRITEENABLE
  881.     
  882.  
  883.  GOTOMARK <Mark name>
  884.  
  885.     Select and display the text corresponding to
  886.     <Mark name>.
  887.  
  888.     'result' set to:
  889.     
  890.     "OK"   - Mark selected and displayed
  891.     
  892.     "NOT FOUND"   - no mark exists of that name
  893.     
  894.     
  895.  DELETEMARK <Mark name>
  896.  
  897.     Delete the mark called <Mark name>.
  898.  
  899.     'result' set to:
  900.     
  901.     "OK"   - Mark deleted
  902.     
  903.     "NOT FOUND"   - no mark exists of that name
  904.  
  905.     "WRITE PROTECTED" - window must be unlocked via WRITEENABLE
  906.     
  907.  
  908.  STATUSTEXT "Text string"
  909.  
  910.     Displays the passed-in text in the status line, replacing the 
  911.     previous status line display.  (The normal status line 
  912.     display can be recovered at any time by clicking on the 
  913.     status line.)
  914.  
  915.  
  916.  ===================================================================
  917.  File/Window Management
  918.  ===================================================================
  919.  
  920.  
  921.  Some of the commands in this section deal with a parameter called
  922.  a 'window-pointer'.  These may be saved by your program and later
  923.  used to select the active window.  They are valid as long as that
  924.  window is open.  This parameter is bound to the window, not the
  925.  file.  As a result, it always describes the same window, even if
  926.  the filename of that window changes (perhaps via SAVEAS).
  927.  
  928.  See also the 'GET window <num>' command, which also returns a
  929.  'window-pointer'.
  930.  
  931.  
  932.  OPENFILE "filename"
  933.  
  934.     Reads in the specified file from disk, unless the file is
  935.     already open.  TEXTRA first expands the "filename" to its
  936.     full pathname equivalent, then checks the titles of its
  937.     current windows for a match.
  938.     
  939.     If the specified file is already open, it is brought to the
  940.     front and the cursor is set to 0,0 (just as if the file was
  941.     freshly opened).
  942.     
  943.     If the specified file is not open, and can't be found on the
  944.     disk, an empty window is created and given the specified
  945.     filename.
  946.     
  947.     NOTE: Do not pass a string that describes a directory to 
  948.           OPENFILE.  It will create a window, then present the 
  949.           file requester on that directory,  thereby requiring 
  950.           user input via the mouse.  Currently, OPENFILE does not 
  951.           wait for the selection before returning to the AREXX 
  952.           script, which operates on the window in that condition 
  953.           (with the requester in place).  (This will be protected 
  954.           against in a future version.)
  955.     
  956.     'result' set to:
  957.     
  958.     "window-pointer"  = descriptor to later use to re-select this
  959.                         window (see SELECTWINDOW)
  960.     
  961.     "0"               = window could not be opened
  962.  
  963.  
  964.  OPENFILEWAIT "filename"
  965.  
  966.     Works identically to OPENFILE, except that this command will
  967.     not return until the edited window is closed.
  968.     
  969.     THIS COMMAND IS ONLY FOR USE FROM EXTERNAL PROGRAMS.  DO NOT
  970.     EXECUTE THIS COMMAND FROM TEXTRA, EITHER IN A SCRIPT OR
  971.     AS A DIRECT COMMAND.
  972.     
  973.     This command was added to support programs like mail readers,
  974.     which sometimes expect the editor to NOT return until the
  975.     user is finished with the specified document.
  976.  
  977.  
  978.  FINDFILE "filename"
  979.  
  980.     TEXTRA first expands the "filename" to its full pathname 
  981.     equivalent, then checks the titles of its current windows 
  982.     for a match.
  983.     
  984.     If the filename is found, it is brought to the
  985.     front and the associated 'window-pointer' is returned.
  986.     
  987.     FINDFILE is similar to OPENFILE, except that it never
  988.     creates a new window.
  989.     
  990.     'result' set to:
  991.     
  992.     "window-pointer"  = descriptor to later use to re-select this
  993.                         window (see SELECTWINDOW)
  994.     
  995.     "0"               = filename not found as a window title
  996.  
  997.  
  998.  INSERTFILE "filename"
  999.  
  1000.     Reads the specified file into the selected window at the
  1001.     current cursor/select position.  v1.13 and later (only)
  1002.     
  1003.     'result' set to:
  1004.     
  1005.     "OK"              = FIle found and inserted
  1006.     "NOT FOUND"       = passed in filename could not be located
  1007.     "WRITE PROTECTED" = selected file is write protected
  1008.  
  1009.  
  1010.  SELECTWINDOW "window-pointer"
  1011.  
  1012.     The specified window is brought to the front and made
  1013.     the current window.
  1014.     
  1015.     The window-pointer parameter must have been aquired from
  1016.     either OPENFILE or FINDFILE, and the window must still be
  1017.     open.
  1018.     
  1019.     v1.13 and later (only)...  SELECTWINDOW returns...
  1020.     
  1021.     "OK"              = Window found and selected
  1022.     "NOT FOUND"       = passed in value was not a valid window-
  1023.                         pointer
  1024.  
  1025.  
  1026.  SAVEAS "filename"
  1027.  
  1028.     The currently selected window is saved to disk under the
  1029.     specified name.
  1030.     
  1031.     If the specified filename is a single asterisk, i.e. "*",
  1032.     the file will be written under the currently existing
  1033.     filename (equivalent to a SAVE operation).
  1034.     
  1035.     'result' set to:
  1036.     
  1037.     "OK"             = file successfully written
  1038.     "ERROR"          = some error occured, file not saved
  1039.     "NOT FOUND"      = "filename" either describes a directory
  1040.                        or contains an invalid pathname component
  1041.     "FILE NOT NAMED" = a "*" has been specified, but the file has
  1042.                        never been given a name
  1043.  
  1044.  
  1045.  CLOSEWINDOW
  1046.  
  1047.     The currently selected window is closed unless it is the
  1048.     last window.
  1049.  
  1050.     'result' set to:
  1051.     
  1052.     "RANGE ERROR"    = file is the last one open (can't be closed
  1053.                        via ARexx)
  1054.     "window-pointer" = the selected window was closed, the returned
  1055.                        "file-pointer" is for the new selected window
  1056.     
  1057.  PLACEWINDOW  leftedge topedge width height
  1058.  
  1059.     Positions the window to the supplied screen-relative coordinates.
  1060.     Example:   PlaceWindow 20 20 300 100
  1061.     
  1062.     If successful, one might want to perform a 'GET window info'
  1063.     operation, to obtain the new value for number-of-visible-lines
  1064.     and number-of-visible-chars, which are both dependant on the
  1065.     user-selected font.
  1066.     
  1067.     If -1 is used for any input parameter, no change in that window
  1068.     dimension (only) will be made.  For example...
  1069.     
  1070.       PLACEWINDOW "-1" "-1" "-1" "-1"   /*arexx needs the quotes*/
  1071.     
  1072.     ...will not change the window position at all.
  1073.     
  1074.     result set to:
  1075.     
  1076.     "RANGE ERROR"   = supplied coordinates are too large, too small
  1077.                       or OS error
  1078.     "OK"            = Window successfully placed
  1079.  
  1080.  
  1081.  WRITEPROTECT
  1082.  
  1083.     Identical to the menu item behavior, "locks" the window against
  1084.     changes by either the user or ARexx.  Commands which normally
  1085.     change window text will set rc=30 and, if appropriate,
  1086.     return result="WRITE PROTECTED".
  1087.  
  1088.  
  1089.  WRITEENABLE
  1090.  
  1091.     Identical to the menu item behavior, "unlocks" the window allowing
  1092.     changes by both user and ARexx.  All commands operate normally.
  1093.  
  1094.  
  1095.     Revision History
  1096.     ----------------
  1097.     
  1098.     v1.10 (Did not support the TEXTRAVERSION command)
  1099.           - Initial ARexx release
  1100.  
  1101.     v1.11 (Did not support the TEXTRAVERSION command)
  1102.           - Fixed GET CURSOR CHAR problem (probable crash
  1103.             if cursor was at the end of a line)
  1104.  
  1105.     These flavors are represented by the third digit in the
  1106.     TEXTRAVERSION ARexx command.  Refer to the text for that
  1107.     command.
  1108.     
  1109.     v1.12 (TEXTRAVERSION returns 1 12 2) 
  1110.           - Replace WRAPAT.textra script with PARAGRAPH.textra
  1111.           - Added File/Window Management section
  1112.           - Added TEXTRAVERSION command
  1113.  
  1114.     v1.13 (TEXTRAVERSION returns 1 13 5) 
  1115.           - Select "next word"-type words will now select
  1116.             Alpha-NUMERIC strings.  (Earlier versions only selected
  1117.             alphabetics) (Beta2)
  1118.           - If no "s:Textra.cmds" file exists, default strings are
  1119.             placed in the ARexx requester string gadgets (including
  1120.             one "@command"-type ARexx STRING FILE as an example).
  1121.             (Beta2)
  1122.           - Added INSERTFILE <filename> (Beta3)
  1123.           - TEXTRAVERSION  returns "1 13 3" (Beta2 was still "1 13 2")
  1124.             (Beta3)
  1125.           - '.textra' ARexx scripts can now be used like normal commands
  1126.             inside other '.textra' ARexx scripts.   (Beta3)
  1127.           - Fixed problem in ARexx interface that would cause a deadlock
  1128.             if 'address "TEXTRA"' was used within a .textra script (Beta7)
  1129.           - CLOSEWINDOW command  (Beta9)
  1130.           - CHECKCANCEL command  (Beta9)
  1131.           - version returns 1 13 4 (Beta12)
  1132.           - SELECTWINDOW was broken in Beta8... window would become active,
  1133.             but all subsequent events went to previously-selected window!
  1134.             (Beta12)
  1135.           - Added the following attributes to PREFS command/1 13 5 (Beta14)
  1136.               [Alphanumeric]      [read on off]
  1137.               [AlphanumericHops]  [read on off]
  1138.     
  1139.     v1.14 (TEXTRAVERSION returns 1 14 6)
  1140.           - Added the QUITTEXTRA command
  1141.           - Fixed a possible crash in the CLEAR command
  1142.           - Fixed a possible crash in the CLOSEWINDOW command
  1143.  
  1144.     v1.15 (TEXTRAVERSION returns 1 15 12)
  1145.           - Added the MARKSELECT command
  1146.           - Added the GOTOMARK command
  1147.           - Added the DELETEMARK command
  1148.           - Added the PREFS WrapFind [on off read] attribute
  1149.           - removed [ConvertCRLF] option for PREFS command as Textra
  1150.             is now MSDOS-text-compatible.
  1151.           - Added the GOTOXY1 and STATUSTEXT commands.
  1152.           - Added the 'GET file info', 'GET window info', 'GET window <num>'
  1153.             and the PLACEWINDOW commands
  1154.           - Added the LINE, LINE1, COLUMN and COLUMN1 commands
  1155.           - (Beta9) When Write-protected, commands which don't change
  1156.             window will work. (In beta8, nothing but WRITEENABLE
  1157.             worked... the files.textra scripts would fail if
  1158.             a write-protected window existed. Also, rexx commands
  1159.             which write to file now report errors. (rexxver to 11)
  1160.           - Added the OPENFILEWAIT command (rexxver to 12)
  1161.  
  1162.     v1.16 (TEXTRAVERSION returns 1 16 12 in Beta7)
  1163.           - Documented the INSERTFILE command (somehow never got in here?)
  1164.  
  1165.     v1.17 (TEXTRAVERSION returns 1 17 13)
  1166.           - Added 'GET window font' and SETFONT
  1167.  
  1168.     v1.18 (TEXTRAVERSION returns 1 18 13)
  1169.  
  1170.